// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

int t;


vector<int> brutalforce() {
	set<int> S;
	vector<int> res = {1, 2, 3};
	S.insert(1);
	S.insert(2);
	S.insert(3);

	while (1) {
		bool fd = false;
		vector<pair<int, pair<int, int>>> candi;
		for (int i=1; i<=300; ++i) {
			for (int j=1; j<=300; ++j) {
				if (i != j && !S.count(i^j) && !S.count(i) && !S.count(j)) {
					candi.push_back(make_pair(i, make_pair(j, i^j)));
				}
			}
		}
		if (sz(candi) == 0)
			return res;
		auto p = *min_element(candi.begin(), candi.end());
		dbg(p.first, p.second.first, p.second.second);
		res.push_back(p.first);
		res.push_back(p.second.first);
		res.push_back(p.second.second);
		S.insert(p.first);
		S.insert(p.second.first);
		S.insert(p.second.second);
	}
	return res;
}

int main(int argc, char const *argv[]) {
    // code

	auto res = brutalforce();
	for (int i=0; i<sz(res); i+=3)
		dbg(i, res[i], res[i+1], res[i+2]);
	int j = 0;
	for (int i=0; i<sz(res); i+=3) {
		++j;
		if (j % 4 == 2)
			dbg(i, res[i], res[i+1], res[i+2]);
	}

    return 0;
}